import { useCallback, useState } from 'react'

function App() {
  const [count, setCount] = useState(0)
  const increament1 = () => {
    console.log('执行increament1')
    setCount(count + 1)
  }
  const  increament2 = useCallback(()=>{
    console.log('执行increament2')
    setCount(count + 1)
  },[count])

  return (
    <div className="App">
      <div>次数:{count}</div>
      <button onClick={increament1}>increament1</button>
      <button onClick={increament2}>increament2</button>
    </div>
  )
}

export default App
